<!DOCTYPE html>
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">

    <title>抑郁症在线检测平台-问答</title>

    <!-- Stylesheets -->
    <link href="./css/style.css" rel="stylesheet">
    <link href="./css/responsive.css" rel="stylesheet">
    <link rel="icon" href="./images/favicon.ico" type="image/x-icon">

</head>

<!-- page wrapper -->
<body class="main_page">


<!-- .preloader -->
<div class="preloader"></div>
<!-- /.preloader -->


<!-- Main Header -->
<div th:insert="~{common:: header}"></div>
<!-- End Main Header -->


<!--Page Title-->
<section class="page-title centred" style="background-image: url(/images/background/page-title-4.jpg);">
    <div class="container">
        <div class="content-box">
            <h1>疑难解答</h1>
            <ul class="bread-crumb clearfix">
                <li><a href="/index">首页</a></li>
            </ul>
        </div>
    </div>
</section>
<!--End Page Title-->


<!-- faq-page-section -->
<section class="faq-page-section">
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-md-12 col-sm-12 content-side">
                <div class="faq-content-side">
                    <div class="inner-box">
                        <h1>疑问解答</h1>
                        <div class="text">我相信你在生活中肯定会遇到一些不开心的事情，但是那又能怎么样呢？日子不还是要继续吗？
                        </div>
                        <div class="text">
                            <p>如果你自己无法排泄出去情绪，不要闷在心里，可以再平台给我们留言，我们会在第一时间内给您回复.</p>
                        </div>

                        <div class="faq-content-two">
                            <h3>为您推荐</h3>
                            <div class="text">
                                <p>我们精心挑出了一些对你们也许有帮助的问答，或许这些能够帮助到您.</p>
                            </div>
                            <ul class="accordion-box">
                                <li class="accordion block" th:each="question:${question}">
                                    <div class="acc-btn">
                                        <div class="icon-outer"><i class="flaticon-add-1"></i></div>
                                        <h5 th:text="${question.getQuestion()}"></h5>
                                    </div>
                                    <div class="acc-content">
                                        <div class="content">
                                            <div class="text" th:text="${question.getAnswer()}">
                                            </div>
                                        </div>
                                    </div>
                                </li>

                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-4 col-md-12 col-sm-12 sidebar-side">
                <div class="faq-sidebar sidebar gray-bg">
                    <div class="sidebar-form">
                        <h3>你可以给我们留言</h3>
                        <div class="text">我们非常期待您的留言，请您如实填写以下信息
                        </div>
                        <form action="#" method="post">

                            <div class="form-group">
                                <label>简要描述您的问题</label>
                                <textarea id="question" name="message"></textarea>
                            </div>
                            <div class="form-group message-btn">
                                <button type="button" id="liuyan" class="theme-btn">即刻留言</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<!-- faq-page-section  end -->



<div th:insert="~{common:: footer}"></div>



<!-- jequery plugins -->
<script src="./js/jquery.js"></script>
<script src="./js/popper.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/owl.js"></script>
<script src="./js/wow.js"></script>
<script src="./js/validation.js"></script>
<script src="./js/jquery.fancybox.js"></script>
<script src="./js/appear.js"></script>

<!-- main-js -->
<script src="./js/script.js"></script>
<script type="text/javascript">
    $("#liuyan").click(function (){
        var question = $("#question").val();
        if (!question) {
            alert("内容不能为空")
            return;
        }
        $.ajax({
            url: '/question/add',
            type: 'POST',
            data: {question:question},
            success: function (result) {
                alert(result.msg);
                return false;
            }
        })
    });
</script>
</body><!-- End of .page_wrapper -->
</html>
